home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / FreshBar / Source / WindowList.h < prev   
Encoding:
C/C++ Source or Header  |  1998-05-29  |  3.8 KB  |  139 lines

  1. //****************************************************************//
  2. // Filename:    WindowList.h
  3. // Autor:       Christian Taulien of Strange Intelligence
  4. // Purpose:     Testprogram for the SIFC
  5. // Creation:    17. Mai 1998
  6. //****************************************************************//
  7. #ifndef TAULIEN_WINDOWLIST_H
  8. #define TAULIEN_WINDOWLIST_H
  9.  
  10. #include <exec/types.h>
  11. #include <exec/nodes.h>
  12. #include <exec/lists.h>
  13. #include <intuition/intuition.h>
  14.  
  15. #include "SIFC_Strings.h"
  16. #include "Bar.h"
  17.  
  18. class BarWindowListC;
  19.  
  20. //*************************************************************************//
  21. //.klasse
  22. //KLASSENNAME   : BarWindowNodeC
  23. //VERSION       : 17. Mai 1998
  24. //AUTOR         : Taulien
  25. //AUFGABE       : Eine Klasse zur eines BalkenFensters (ProgressBarWindow)
  26. //DOKUMENTATION : -
  27. //BEMERKUNGEN   : -
  28. //AENDERUNGEN   : -
  29. //*************************************************************************//
  30. class BarWindowNodeC : public struct Node
  31. {
  32.   friend class BarWindowListC;
  33. private:
  34.   // ## datamembers ##
  35.   BarListC m_oBarList;
  36.   StringC  m_oName;
  37.   StringC  m_oButtonText;
  38.   StringC  m_oScreenName;
  39.   struct Screen  *m_poLockedScreen;
  40.   struct Window  *m_poBarWindow;
  41.   struct MsgPort *m_poSharedUserPort;
  42.   struct Gadget  *m_poFirstGadget;
  43.   struct Gadget  *m_poButton;
  44.   BOOL   m_bGadgetsAttached;
  45.   BOOL   m_bCloseGadget;
  46.   int    m_iWidth;
  47.   int    m_iHeight;
  48.   int    m_iTop;
  49.   int    m_iLeft;
  50.   int    m_iBorderTop;
  51.   int    m_iBorderRight;
  52.   int    m_iBorderLeft;
  53.   int    m_iBorderBottom;
  54.   int    m_iMaxVisibleEntries;
  55.   ULONG  m_ulBarWindowID;
  56.  
  57.   static ULONG m_ulNextFreeID;
  58.  
  59.   // ## methods
  60.   struct Screen *lockScreen();
  61.   void unlockScreen();
  62.   struct Gadget *createGadgets();
  63.   void freeGadgets();
  64.   void clearBarWindow();
  65.   void hideGadgets();
  66.   void showGadgets();
  67.   void validateWindowSize();
  68.  
  69.   BarWindowNodeC(BarWindowListC *arg_poBarList,
  70.                  char *arg_sName,
  71.                  char *arg_sButtonName,
  72.                  char *arg_sScreenName = "",
  73.                  BOOL arg_bCloseGadget=TRUE);
  74.  
  75. public:
  76.   // ## datamembers
  77.  
  78.   // ## methods
  79.   ~BarWindowNodeC();
  80.  
  81.   BOOL openBarWindow();
  82.   void closeBarWindow();
  83.   void setBarWindowWidth(ULONG arg_ulWidth);
  84.   void setBarWindowPos(int arg_iPosX, int arg_iPosY);
  85.   void setBarWindowTitle(char *arg_sName);
  86.   BOOL testOKButton();
  87.  
  88.   struct Window *getWindow() { return m_poBarWindow; }
  89.  
  90.   StringC getName(void)  { return m_oName; }
  91.   ULONG getBarWindowID() { return m_ulBarWindowID; }
  92.  
  93.   BarWindowNodeC *getNext(void);
  94.   BarWindowNodeC *getPrev(void);
  95.  
  96.   BarNodeC *addBar(char *arg_sName, ULONG arg_ulMaxValue = 100);
  97.   void  removeBar(ULONG arg_ulBarID);
  98.   BarNodeC *findBarNode(ULONG arg_ulBarID)
  99.       { return m_oBarList.findBarNode(arg_ulBarID); }
  100.  
  101.   void refreshBars();
  102.   BOOL isOpen() { return m_poBarWindow != NULL; }
  103.   BOOL hasButton() { return !m_oButtonText.isEmpty(); }
  104. };
  105.  
  106. //*************************************************************************//
  107. //.klasse
  108. //KLASSENNAME   : BarWindowListC
  109. //VERSION       : 17. Mai 1998
  110. //AUTOR         : Taulien
  111. //AUFGABE       : Eine Klasse für die Verwaltung verschiedener Balkenfenster
  112. //DOKUMENTATION : -
  113. //BEMERKUNGEN   : -
  114. //AENDERUNGEN   : -
  115. //*************************************************************************//
  116. class BarWindowListC : public struct List
  117. {
  118.   struct MsgPort *m_poSharedUserPort;
  119. public:
  120.   BarWindowListC();
  121.   ~BarWindowListC();
  122.  
  123.   BarWindowNodeC *addBarWindow(char *arg_sName, char *arg_sButtonName,char *arg_sScreenName, BOOL arg_bCloseGadget);
  124.   void removeBarWindow(ULONG arg_ulBarWindowID);
  125.   void removeAll();
  126.  
  127.   BarWindowNodeC *findBarWindowNode(ULONG arg_ulBarWindowID);
  128.   BarWindowNodeC *getFirst() { return (BarWindowNodeC *) lh_Head; }
  129.   int indexOf(BarWindowNodeC *arg_poNode);
  130.   int getSize();
  131.   struct MsgPort *getSharedUserPort() { return m_poSharedUserPort; }
  132.  
  133.   BarWindowNodeC *operator[](int arg_iIndex);
  134. };
  135.  
  136. #endif // TAULIEN_INDOWLIST_H
  137.  
  138.  
  139.